//
//  SingletonViewControl.m
//  OCUI
//
//  Created by bus365-03 on 15/10/23.
//
//

#import "SingletonViewControl.h"
#import <QuartzCore/QuartzCore.h>
@implementation SingletonViewControl
//DEF_SINGLETON(SingletonViewControl)
- (void)viewDidLoad{
    
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor colorWithRed:14.0/255.0 green:136.0/255.0 blue:222.0/255.0 alpha:1.0];
   
    CGFloat width=[[UIScreen mainScreen] bounds].size.width;
    CGFloat height=[[UIScreen mainScreen] bounds].size.height-64;
    
    CGRect btn_frame1=CGRectMake(0,64,width/3,height/3);
    UIButton *btn1=[[UIButton alloc]initWithFrame:btn_frame1];
    btn1.backgroundColor = [UIColor cyanColor];
    [btn1 setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [btn1 setTitle:@"测试" forState:UIControlStateNormal];
    
    CGRect btn_frame2=CGRectMake(0,64+height/3,width/3,height/3);
    UIButton *btn2=[[UIButton alloc]initWithFrame:btn_frame2];
    btn2.backgroundColor = [UIColor redColor];
    [btn2 setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [btn2 setTitle:@"测试" forState:UIControlStateNormal];
    
    CGRect btn_frame3=CGRectMake(0,64+height/3*2,width/3,height/3);
    UIButton *btn3=[[UIButton alloc]initWithFrame:btn_frame3];
    btn3.backgroundColor = [UIColor greenColor];
    
    //CAShapeLayer *border = [CAShapeLayer layer];
    
    
    
    [btn3.layer setBorderWidth:5.0];
    [btn3.layer setBorderColor:[[UIColor colorWithPatternImage:[UIImage imageNamed:@"DotedImage.png"]] CGColor]];
    
    [btn3 setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [btn3 setTitle:@"测试" forState:UIControlStateNormal];
    
    
    [self setTitle:@"单例模式"];
    [self.view addSubview:btn1];
    [self.view addSubview:btn2];
    [self.view addSubview:btn3];
    
    NSLog(@"btn1 height is %f",btn1.bounds.size.height);
    NSLog(@"btn2 height is %f",btn2.bounds.size.height);
    NSLog(@"btn2 height is %f",btn3.bounds.size.height);
    
  
    
}
@end
